package com.lovejes.app.plugin;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.lovejes.app.dao.impl.CommonDao;
import com.lovejes.app.service.impl.AppMemoryService;
import com.lovejes.exception.LoveJesException;

public class AppInitServlet extends HttpServlet {
	Log logger = LogFactory.getLog(AppInitServlet.class);
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public void init() throws ServletException {
		ServletContext context=this.getServletContext();
		AppMemoryService memoryService=AppMemoryService.getInstance();
		CommonDao commonDao = new CommonDao();
		try {
			memoryService.syncFMenuTree(context);
			commonDao.initJesVcount();
		} catch (LoveJesException e) {
			logger.error(e);
		}
	}
}